Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launcher: set preferred language list from system locale #732

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rawoul
Copy link
Contributor

@rawoul rawoul commented Aug 28, 2024

This changes the Accept-Language header to match the system locale by default.

launcher/cog-launcher.c Outdated Show resolved Hide resolved
launcher/cog-launcher.c Outdated Show resolved Hide resolved
launcher/cog-launcher.c Outdated Show resolved Hide resolved
@rawoul
Copy link
Contributor Author

rawoul commented Aug 29, 2024

Thanks for the review, I've fixed the issues you raised and factored the code in a separate function for clarity.

@TingPing
Copy link
Member

TingPing commented Aug 29, 2024

I have one concern, this exposes system information directly to the web which adds information for fingerprinting. Browsers like Safari specifically filter and reduce this list to make it less unique.

If this does or doesn't matter to Cog is probably for another dev to decide.


/* build Accept-Language from locale, filtering out encodings */
locales = g_get_language_names();
length = g_strv_length((gchar **) g_get_language_names());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might have to reformat the languages.

MDN says the format is en-US yet this will return en_US.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants